package com.leng.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Author: 冷俊杰
 * @Description: 门禁设备实体类
 * @DateTime: 2022/7/18 14:26
 **/
@Getter
@Setter
@ToString
public class AccessControlDevice implements Serializable {
    /**
     * 设备编号
     */
    private Integer id;

    /**
     * 负责人
     */
    private String principal;

    /**
     * 供货商
     */
    private String supplier;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 楼宇编号，对应楼宇表主键
     */
    private Integer hospital_id;

    /**
     * 0：停用，1：启用
     */
    private Integer status;

    /**
     * yyyy-MM-dd
     * //@DateTimeFormat注解将yyyy-MM-dd的形式转换为Date数据
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date addTime;

    private Buiding buiding;

    private static final long serialVersionUID = 1L;

    public AccessControlDevice(String principal, String supplier, String brand, Integer hospital_id, Date addTime) {
        this.principal = principal;
        this.supplier = supplier;
        this.brand = brand;
        this.hospital_id = hospital_id;
        this.addTime = addTime;
    }

    public AccessControlDevice(Integer id, String principal, String supplier, String brand, Integer hospital_id, Integer status, Date addTime, Buiding buiding) {
        this.id = id;
        this.principal = principal;
        this.supplier = supplier;
        this.brand = brand;
        this.hospital_id = hospital_id;
        this.status = status;
        this.addTime = addTime;
        this.buiding = buiding;
    }

    public AccessControlDevice(Integer status,Integer id) {
        this.status = status;
        this.id = id;
    }

    public AccessControlDevice() {
    }
}